{*<!--

+---------------------------------------------------------------------------+
| Revive Adserver                                                           |
| http://www.revive-adserver.com                                            |
|                                                                           |
| Copyright: See the COPYRIGHT.txt file.                                    |
| License: GPLv2 or later, see the LICENSE.txt file.                        |
+---------------------------------------------------------------------------+

-->

<table border='0' width='100%' cellpadding='0' cellspacing='0'>
*}

<div id="adsense-create-form" {if $hide}style="display: none"{/if}>
  {*
    Information message, do not display when the error messages below are displayed.
  *}
  {if true}
  <div class="infomessage">
    Please provide an address to which Google will send an email requesting a bit more
    information from you to get your Google AdSense account set up. Also, provide a name for
    this account within OpenX.
  </div>
  {/if}

  {*
    Error message to be shown when there already is an AdSense account
    associated with the provided email.
  *}
  {if false}
  <div class="errormessageicon">
    There is already an AdSense account associated with email: <b>test@test.com</b>. Please
    provide a different e-mail address or <a href="adsense-link.php?email=test@test.com">link OpenX to this existing AdSense account</a>.
    {*
      TODO: It would be good to prefill the Email field on the adsense-link screen reachable
      from the link above with the Email address the user has typed.
    *}
  </div>
  {/if}

  <form id="adsense-create" class="validate" action="adsense-accounts.php">
    <input type="hidden" name="info" value="linked" />
    {include file=edit-table/create.html from=$fields}

    <div class="terms" style="margin-top: 30px">
      {include file=adsense-terms.html}
    </div>

    <input type="checkbox" id="termsconsent" />
    <label class="cb" for="termsconsent">I have read and understood Google AdSense terms of service</label>

    <div class="controls">
      <input id="submit" value="Create AdSense Account" class="main-submit" type="submit" {tabindex}>
      <span id="termshint" class="hint">To create AdSense account, you must agree to terms of service above</span>
    </div>
  </form>
</div>

<script>
{literal}
  $(document).ready(function() {
    var checkTerms = function() {
      var checkbox = $("#termsconsent")[0];
      if (checkbox.checked) {
        $("#termshint").fadeOut();
        $("#submit").attr("disabled", false);
      }
      else {
        $("#termshint").fadeIn();
        $("#submit").attr("disabled", true);
      }
    };
    $("#termsconsent").click(checkTerms);
    checkTerms();
  });
{/literal}
</script>

{*
</table>
*}
